package com.bibrApp.difu.adapter;

import com.bibrApp.difu.R;
import com.bibrApp.difu.Response.LoginLogResBody;
import com.bibrApp.difu.utils.CalendarUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import androidx.annotation.NonNull;

/**
 * @CreateDate 2020/3/16
 * @Author dj
 */
public class LoginLogAdapter extends BaseQuickAdapter<LoginLogResBody.loginItem, BaseViewHolder> {

    public LoginLogAdapter() {
        super(R.layout.item_login_log);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, LoginLogResBody.loginItem item) {

        helper.setText(R.id.item_log_time, CalendarUtils.formatHisEntrustDate(item.getTime()))
                .setText(R.id.item_log_type, item.getType() == 0 ? "web":"app")
                .setText(R.id.item_log_ip, item.getIp())
                .setText(R.id.item_log_status, item.getStatus() == 0  ? "失败" : "成功");
    }

}